package hero.mps.web.school_class.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import hero.mps.web.school_class.entity.ClassParam;
import hero.mps.web.school_class.entity.SchoolClass;
import hero.mps.web.school_class.mapper.SchoolClassMapper;
import hero.mps.web.school_class.service.SchoolClassService;
import org.springframework.stereotype.Service;

@Service
public class SchoolClassServiceImpl extends ServiceImpl<SchoolClassMapper, SchoolClass> implements SchoolClassService {

    @Override
    public IPage<SchoolClass> getList(ClassParam classParam) {
        // 构建分页对象
        IPage<SchoolClass> page = new Page(classParam.getCurrentPage(), classParam.getPageSize());
        return this.baseMapper.getList(page, classParam);
    }
}
